/**
 * @author nttdocomo
 */
define(function(require){
	require("aries");
	require("../base");
	aries.augmentString('aries.templates.button_button',_.template([
        '<em id="<%=id%>-btnWrap"<%if(splitCls){%> class="<%=splitCls%>"<%}%>>',
            '<%if(href){%>',
                '<a id="<%=id%>-btnEl" href="<%=href%>" class="<%=btnCls%>" target="<%=hrefTarget%>"',
                    '<%if(typeof(tabIndex)!=="undefined"){%> tabIndex="<%=tabIndex%>"<%}%>',
                    '<%if(typeof(disabled)!=="undefined"){%> disabled="disabled"<%}%>',
                    ' role="link">',
                    '<span id="<%=id%>-btnInnerEl" class="<%=baseCls%>-inner">',
                        '<%=text%>',
                    '</span>',
                    '<span id="<%=id%>-btnIconEl" class="<%=baseCls%>-icon <%=iconCls%>"<tpl if="iconUrl"> style="background-image:url(<%=iconUrl%>)"></span>',
                '</a>',
            '<%}else{%>',
                '<button id="<%=id%>-btnEl" type="<%=type%>" class="<%=btnCls%>" hidefocus="true"',
                    // the autocomplete="off" is required to prevent Firefox from remembering
                    // the button's disabled state between page reloads.
                    '<%if(typeof(tabIndex)!=="undefined"){%> tabIndex="<%=tabIndex%>"<%}%>',
                    '<%if(typeof(disabled)!=="undefined"){%> disabled="disabled"<%}%>',
                    ' role="button" autocomplete="off">',
                    '<span id="<%=id%>-btnInnerEl" class="<%=baseCls%>-inner" style="<%=innerSpanStyle%>">',
                        '<%=text%>',
                    '</span>',
                    '<span id="<%=id%>-btnIconEl" class="<%=baseCls%>-icon <%=iconCls%>"<%if(typeof(iconUrl)!=="undefined"){%> style="background-image:url(<%=iconUrl%>)"<%}%>></span>',
                '</button>',
            '<%};%>',
        '</em>',
        '<%if(typeof(closable)!=="undefined"){%>',
            '<a id="<%=id%>-closeEl" href="#" class="<%=baseCls%>-close-btn" title="<%=closeText%>"></a>',
        '<%};%>'
    ].join('')));
	aries.view("aries.views.button.Button",aries.views.Base.extend())
})
